home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / srcuc.zip / HPPACACH.H < prev    next >
C/C++ Source or Header  |  1990-11-30  |  4KB  |  127 lines

  1. /* -*-C-*-
  2.  
  3. $Header: hppacache.h,v 1.3 90/12/01 00:21:04 GMT cph Exp $
  4.  
  5. Copyright (c) 1990 Massachusetts Institute of Technology
  6.  
  7. This material was developed by the Scheme project at the Massachusetts
  8. Institute of Technology, Department of Electrical Engineering and
  9. Computer Science.  Permission to copy this software, to redistribute
  10. it, and to use it for any purpose is granted, subject to the following
  11. restrictions and understandings.
  12.  
  13. 1. Any copy made of this software must include this copyright notice
  14. in full.
  15.  
  16. 2. Users of this software agree to make their best efforts (a) to
  17. return to the MIT Scheme project any improvements or extensions that
  18. they make, so that these may be included in future releases; and (b)
  19. to inform MIT of noteworthy uses of this software.
  20.  
  21. 3. All materials developed as a consequence of the use of this
  22. software shall duly acknowledge such use, in accordance with the usual
  23. standards of acknowledging credit in academic research.
  24.  
  25. 4. MIT has made no warrantee or representation that the operation of
  26. this software will be error-free, and MIT is under no obligation to
  27. provide any services, by way of maintenance, update, or otherwise.
  28.  
  29. 5. In conjunction with products arising from the use of this material,
  30. there shall be no use of the name of the Massachusetts Institute of
  31. Technology nor of any adaptation thereof in any advertising,
  32. promotional, or sales literature without prior written consent from
  33. MIT in each case. */
  34.  
  35. #ifndef HPPACACHE_H        /* Prevent multiple inclusion */
  36. #define HPPACACHE_H
  37.  
  38. #define I_CACHE        1
  39. #define D_CACHE        2
  40.  
  41. #include <sys/utsname.h>
  42. #include <sys/types.h>
  43. #include <sys/param.h>
  44. #include <machine/cpu.h>
  45. #include <machine/pdc_rqsts.h>
  46. #include <fcntl.h>
  47.  
  48. /* PDC_CACHE (processor dependent code cache information call)
  49.    return data destructuring.
  50.  
  51.    This is the same information as in machine/pdc_rqsts.h
  52.    pdc_cache_rtn_block, but with fields as defined in the PDC_CACHE
  53.    section of the I/O Architecture Manual.
  54.  
  55.    The main difference is the cache configuration field.
  56.    Which is correct?  */
  57.  
  58. union cache_conf
  59. {
  60.   unsigned long word;
  61.   struct
  62.   {
  63.     unsigned block:    8;
  64.     unsigned line:    3;
  65.     unsigned res1:    2;
  66.     unsigned wt:    1;
  67.     unsigned fsel:    2;
  68.     unsigned cst:    3;
  69.     unsigned res2:    11;
  70.     unsigned hv:    2;
  71.   } bits;
  72. };
  73.  
  74. struct cache_info
  75. {
  76.   unsigned long size;        /* in bytes */
  77.   union cache_conf conf;    /* format description */
  78.   unsigned long base;        /* start address */
  79.   unsigned long stride;        /* in bytes */
  80.   unsigned long count;        /* number of entries */
  81.   unsigned long loop;        /* set associativity */
  82. };
  83.  
  84. union tlb_conf
  85. {
  86.   unsigned long word;
  87.   struct
  88.   {
  89.     unsigned res1:    12;
  90.     unsigned psel:    2;
  91.     unsigned hv1:    1;
  92.     unsigned res2:    1;
  93.     unsigned cst:    3;
  94.     unsigned res3:    11;
  95.     unsigned hv2:    2;
  96.   } bits;
  97. };
  98.  
  99. struct tlb_info
  100. {
  101.   unsigned long size;        /* number of entries */
  102.   union tlb_conf conf;        /* format description */
  103.   unsigned long sp_base;    /* space parameters */
  104.   unsigned long sp_stride;
  105.   unsigned long sp_count;
  106.   unsigned long off_base;    /* offset parameters */
  107.   unsigned long off_stride;
  108.   unsigned long off_count;
  109.   unsigned long loop;        /* set associativity */
  110. };
  111.  
  112. struct pdc_cache_result
  113. {
  114.   struct cache_info I_info;
  115.   struct cache_info D_info;
  116.   struct tlb_info IT_info;
  117.   struct tlb_info DT_info;
  118. };
  119.  
  120. struct pdc_cache_dump
  121. {
  122.   char hardware[sizeof (utsname.machine)];
  123.   struct pdc_cache_rtn_block cache_format;
  124. };
  125.  
  126. #endif /* HPPACACHE_H */
  127.